@extends('back.layout')
@section('css')

    <link rel="stylesheet" href="{{asset('css/simplemde.min.css')}}">

@endsection

@section('content')
    @include('editor::head')
    <script src="{{asset('js/simplemde.min.js')}}"></script>
    <div class="container">
        <div class="row">
            <div class="col m8 s12 admin-post">
                <form action="{{route('post.store')}}" method="post">
                    {{csrf_field()}}
                    <div class="input-field">
                        <input id="title" type="text" class="validate" name="title">
                        <label for="title">标题</label>

                    </div>
                    <div class="input-field">
                    <input id="img" type="text" class="validate" name="img" >
                    <label for="title">封面</label>
                    </div>
                    <label>选择标签</label>
                    <p>
                        @foreach(\App\Tag::all() as $tag)
                            <input type="checkbox" name="tags[]" class="filled-in" id="{{$tag->id}}" value="{{$tag->id}}" />
                            <label for="{{$tag->id}}">{{$tag->tag}}</label>
                        @endforeach

                    </p>

                    <div class="editor">
                        <textarea name="body" id='myEditor'></textarea>
                    </div>

                    <div class="input-field center">
                        <input class="btn" type="submit" value="马上发布">
                    </div>
                </form>
            </div>
        </div>
    </div>

@endsection
